package com.z6school.manage.controller;


import com.z6school.manage.common.pojo.JsonResult;

import com.z6school.manage.common.pojo.Nodes;
import com.z6school.manage.po.School;
import com.z6school.manage.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;


@RestController
@RequestMapping("/dept/")
public class DeptController {

    @Autowired
    private DeptService deptService;

//    @RequestMapping("doFindObjects")
//    public JsonResult doFindObjects(){
//        List<Map<String, Object>> objects = deptService.findObjects();
//        return new JsonResult(objects);
//    }

//    @RequestMapping("doDeleteObject")
//    public JsonResult doDeleteObject(Integer id){
//        deptService.deleteObject(id);
//        return new JsonResult("delete ok");
//    }

//    @RequestMapping("doSaveObject")
//    public JsonResult doSaveObject(School school){
//         deptService.saveObject(school);
//        return new JsonResult("添加成功");
//    }

//    @RequestMapping("doUpdateObject")
//    public JsonResult doUpdateObject(School school){
//        deptService.updateObject(school);
//        return new JsonResult("修改成功");
//    }

    @RequestMapping("doFindById")
    public JsonResult doFindById(Integer id){
        School school = deptService.findById(id);
        return new JsonResult(school);
    }

//    @RequestMapping("doFindZTreeNodes")
//    public JsonResult doFindZTreeNodes(){
//        List<Nodes> zTreeNodes = deptService.findZTreeNodes();
//        return new JsonResult(zTreeNodes);
//    }
}
